import request from "@/utils/requestJava.js"

export default {
	/**
	 * 获取所有的订单号，用于关联
	 */
	async listRelatedOrder() {
		return await request({
			url: "/api/orderSell/getOrderNumList",
			method: 'GET',
			contentType: 2,
			channel: 2
		})
	},
	
	/**
	 * 创建订单
	 * @param {Object} data
	 */
	async createOrder(data){
		return await request({
			url: '/api/v2/order/createApp',
			method: 'POST',
			data:data,
			contentType: 2,
			channel: 2	,
			
		})		
	},
	
	/**
	 * 更新订单
	 * @param {Object} data
	 */
	async updateOrder(data){
		return await request({
			url: '/api/v2/order/update',
			method: 'POST',
			data:data,
			contentType: 2,
			channel: 2	,
			
		})		
	},
		
	/**
	 * 编辑订单信息获取
	 * @param {Object} data
	 */
	async getOrder(data){
		return await request({
			url:'/api/v2/order/get/'+data,
			method: 'GET',
			contentType: 2,
			channel: 2					
		})		
	},	
	
	/**
	 * 补单 订单信息获取
	 * @param {Object} data
	 */
	async getBySaleId(data){
		return await request({
			url:'/api/v2/order/getBySaleId/'+data,
			method: 'GET',
			contentType: 2,
			channel: 2					
		})		
	},	
	
	/**
	 * 订单补单
	 * @param {Object} data
	 */
	async repairOrder(data){
		return await request({
			url:"/api/order/repairOrder",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})
	},
		
	/**
	 * 订单列表
	 * @param {Object} data
	 */
	async list(data){
		return await request({
			url:"/api/v2/order/list",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})
	},

	/**
	 * 采购订单列表
	 * @param {Object} data
	 */
	async getSaleOrderList(data){
		return await request({
			url:"/api/v2/order/saleList",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})
	},
		
	/**
	 * 订单总数
	 * @param {Object} data
	 */
	async getTotal(data){
		return await request({
			url:"/api/order/getSellTotal",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})
	},

	/**
	 * 采购订单总数
	 * @param {Object} data
	 */
	async getSaleTotal(data){
		return await request({
			url:"/api/order/getSaleTotal",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})
	},
		
	/**
	 * 获取细节
	 * @param {Object} data
	 */
	async getDetail(data){
		return await request({
			url:"/api/v2/order/getOrderDetail",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},
	
	/**
	 * 获取备货单
	 * @param {Object} data
	 */
	async getStockList(data){
		return await request({
			url:"/api/orderSale/getStockList/"+data,
			method:'POST',
			contentType:2,
			channel:2
		})		
	},
		
	/**
	 * 取消订单
	 * @param {Object} data
	 */
	async cancelOrder(data){
		return await request({
			url:"/api/v2/order/cancelOrder",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},	
	
	/**
	 * 取消采购订单
	 * @param {Object} data
	 */
	async cancelSaleOrder(data){
		return await request({
			url:"/api/orderSale/logAdd",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},
			
	/**
	 * 换单
	 * @param {Object} data
	 */
	async changeOrder(data){
		return await request({
			url:"/api/order/changeOrder",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},	
				
		
	/**
	 * 获取订单数据
	 * @param {Object} data
	 */
	async getSellFaHuo(data){
		return await request({
			url:"/api/orderSell/getSellFaHuo/"+data,
			method:'GET',
			contentType:2,
			channel:2
		})		
	},	
			
	/**
	 * 订单签收
	 * @param {Object} data
	 */
	async signOrder(data){
		return await request({
			url:"/api/sign/signOrder",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},		
			
	/**
	 * 订单回款
	 * @param {Object} data
	 */
	async belongReturn(data){
		return await request({
			url:"/api/orderPayment/belongReturn",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},	
		
	/**
	 * 订单列表
	 */
	async getPriceList(){
		return await request({
			url:"/api/price/getPriceList",
			method:'POST',
			contentType:2,
			channel:2
		})		
	},	
				
	/**
	 * 采购下单
	 */
	async purchaseOrder(data){
		return await request({
			url:"/api/v2/order/purchaseOrder",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},	
				
	/**
	 * 获取跟单员集合
	 */
	async getGenDanYuan(data){
		return await request({
			url:"/api/OrderMerchandiser/getOrderMerchandiserList",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},		
				
	/**
	 * 更新跟单员
	 */
	async updateGenDan(data){
		return await request({
			url:"/api/orderSell/updateGenDan",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},	
					
	/**
	 * 订单改价
	 */
	async adjustPrice(data){
		return await request({
			url:"/api/adjustPrice/update",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},	
					
	/**
	 * 订单日志
	 */
	async selectLogsByOrder(data){
		return await request({
			url:"/api/operLog/selectLogsByOrder",
			method:'POST',
			data:data,
			contentType:2,
			channel:2
		})		
	},						
}